let str = 'hello world hello';
// console.log(str.replace("hello", "haha"));
// haha world hello

str = 'aaaabbbbaaaabbbb';
// console.log(str.replace(/b{4}/g, "wwww"));
// aaaawwwwaaaawwww

str.replace(/aa(b{4})/g, function(...payload) {
  console.log('payload', payload);
});
